package com.daify.threadlearn.chapter01.order03;

import java.util.HashSet;
import java.util.Set;

/**
 * @author daify
 * @date 2019-06-05
 */
public class OneSet {

    private final Set<String> set = new HashSet<String>();

    public synchronized void addItem(String str) {
        set.add(str);
    }

    public synchronized boolean containsPerson(String str) {
        return set.contains(str);
    }
}
